home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/pwd,v $
- * $Date: 1996/10/30 21:58:58 $
- * $Revision: 1.2 $
- * $State: Rel $
- * $Author: unixlib $
- *
- * $Log: pwd,v $
- * Revision 1.2 1996/10/30 21:58:58 unixlib
- * Massive changes made by Nick Burret and Peter Burwood.
- *
- * Revision 1.1 1996/04/19 21:02:57 simon
- * Initial revision
- *
- ***************************************************************************/
-
- /* POSIX Standard 9.2.2 User Database Access <pwd.h>. */
-
- #ifndef __PWD_H
- #define __PWD_H
-
- #ifndef __UNIXLIB_TYPES_H
- #include <unixlib/types.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- struct passwd
- {
- /* Username. */
- char *pw_name;
- /* Password. */
- char *pw_passwd;
- /* User ID. */
- __uid_t pw_uid;
- /* Group ID. */
- __gid_t pw_gid;
- /* Real name. */
- char *pw_gecos;
- /* Home directory. */
- char *pw_dir;
- /* Shell program. */
- char *pw_shell;
- };
-
- /* System V functions. */
-
- /* Rewind the password-file stream. */
- extern void setpwent (void);
- /* Close the password-file stream. */
- extern void endpwent (void);
- /* Read an entry from the password-file stream, opening it if necessary. */
- extern struct passwd *getpwent (void);
- #ifdef FILE
- /* Read an entry from stream. */
- extern struct passwd *fgetpwent (FILE *stream);
- extern int putpwent (const struct passwd *p, FILE *stream);
- #else
- extern struct passwd *fgetpwent (void *stream);
- extern int putpwent (const struct passwd *p, void *stream);
- #endif
-
- /* POSIX functions. */
-
- /* Search for an entry with a matching user ID. */
- extern struct passwd *getpwuid (__uid_t uid);
- /* Search for an entry with a matching username. */
- extern struct passwd *getpwnam (const char *name);
-
- /* Re-construct the password-file line for the given uid in the
- given buffer. */
- extern int getpw (__uid_t uid, char *buf);
-
- /* UnixLib pwd implementation function. */
- #ifdef FILE
- extern struct passwd *__pwdread (FILE *, struct passwd *);
- #else
- extern struct passwd *__pwdread (void *, struct passwd *);
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-